<?php

namespace AdminBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * AuthAssignment
 *
 * @ORM\Table(name="auth_assignment", options={"comment": "角色/权限分配"})
 * @ORM\Entity
 */
class AuthAssignment
{
    /**
     * @var string
     * @ORM\Id
     * @ORM\Column(name="item_name", type="string", length=64, options={"comment": "角色/权限"})
     */
    private $itemName;

    /**
     * @var string
     * @ORM\Id
     * @ORM\Column(name="user_id", type="string", length=64, options={"comment": "用户ID"})
     */
    private $userId;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_at", type="datetime")
     */
    private $createdAt;


    public function __construct($itemName, $userId)
    {
        $this->itemName = $itemName;
        $this->userId = $userId;
    }

    /**
     * Set itemName
     *
     * @param string $itemName
     *
     * @return AuthAssignment
     */
    public function setItemName($itemName)
    {
        $this->itemName = $itemName;

        return $this;
    }

    /**
     * Get itemName
     *
     * @return string
     */
    public function getItemName()
    {
        return $this->itemName;
    }

    /**
     * Set userId
     *
     * @param string $userId
     *
     * @return AuthAssignment
     */
    public function setUserId($userId)
    {
        $this->userId = $userId;

        return $this;
    }

    /**
     * Get userId
     *
     * @return string
     */
    public function getUserId()
    {
        return $this->userId;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     *
     * @return AuthAssignment
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }
}
